package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.DeviceConfigOptionalMapper;
import com.ruoyi.business.domain.DeviceConfigOptional;
import com.ruoyi.business.service.IDeviceConfigOptionalService;

/**
 * 选配设备配置Service业务层处理
 * 
 * @author DL
 * @date 2025-06-29
 */
@Service
public class DeviceConfigOptionalServiceImpl implements IDeviceConfigOptionalService 
{
    @Autowired
    private DeviceConfigOptionalMapper deviceConfigOptionalMapper;

    /**
     * 查询选配设备配置
     * 
     * @param id 选配设备配置主键
     * @return 选配设备配置
     */
    @Override
    public DeviceConfigOptional selectDeviceConfigOptionalById(Long id)
    {
        return deviceConfigOptionalMapper.selectDeviceConfigOptionalById(id);
    }

    /**
     * 根据infoId查询选配设备配置
     *
     * @param id 选配设备配置的infoId
     * @return 选配设备配置
     */
    @Override
    public DeviceConfigOptional selectDeviceConfigOptionalByInfoId(Long id)
    {
        return deviceConfigOptionalMapper.selectDeviceConfigOptionalByInfoId(id);
    }

    /**
     * 查询选配设备配置列表
     * 
     * @param deviceConfigOptional 选配设备配置
     * @return 选配设备配置
     */
    @Override
    public List<DeviceConfigOptional> selectDeviceConfigOptionalList(DeviceConfigOptional deviceConfigOptional)
    {
        return deviceConfigOptionalMapper.selectDeviceConfigOptionalList(deviceConfigOptional);
    }

    /**
     * 新增选配设备配置
     * 
     * @param deviceConfigOptional 选配设备配置
     * @return 结果
     */
    @Override
    public int insertDeviceConfigOptional(DeviceConfigOptional deviceConfigOptional)
    {
        deviceConfigOptional.setCreateTime(DateUtils.getNowDate());
        return deviceConfigOptionalMapper.insertDeviceConfigOptional(deviceConfigOptional);
    }

    /**
     * 修改选配设备配置
     * 
     * @param deviceConfigOptional 选配设备配置
     * @return 结果
     */
    @Override
    public int updateDeviceConfigOptional(DeviceConfigOptional deviceConfigOptional)
    {
        deviceConfigOptional.setUpdateTime(DateUtils.getNowDate());
        return deviceConfigOptionalMapper.updateDeviceConfigOptional(deviceConfigOptional);
    }

    /**
     * 批量删除选配设备配置
     * 
     * @param ids 需要删除的选配设备配置主键
     * @return 结果
     */
    @Override
    public int deleteDeviceConfigOptionalByIds(Long[] ids)
    {
        return deviceConfigOptionalMapper.deleteDeviceConfigOptionalByIds(ids);
    }

    /**
     * 删除选配设备配置信息
     * 
     * @param id 选配设备配置主键
     * @return 结果
     */
    @Override
    public int deleteDeviceConfigOptionalById(Long id)
    {
        return deviceConfigOptionalMapper.deleteDeviceConfigOptionalById(id);
    }
}
